/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author niit
 */
@Entity
@Table(name = "fl_course")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FlCourse.findAll", query = "SELECT f FROM FlCourse f"),
    @NamedQuery(name = "FlCourse.findByCourseid", query = "SELECT f FROM FlCourse f WHERE f.courseid = :courseid"),
    @NamedQuery(name = "FlCourse.findByCourseName", query = "SELECT f FROM FlCourse f WHERE f.courseName = :courseName"),
    @NamedQuery(name = "FlCourse.findByFee", query = "SELECT f FROM FlCourse f WHERE f.fee = :fee"),
    @NamedQuery(name = "FlCourse.findByPrerequisite", query = "SELECT f FROM FlCourse f WHERE f.prerequisite = :prerequisite")})
public class FlCourse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "courseid")
    private Integer courseid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "course_name")
    private String courseName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Fee")
    private float fee;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1000)
    @Column(name = "Prerequisite")
    private String prerequisite;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "courseid")
    private List<FlCoursemasterial> flCoursemasterialList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "courseid")
    private List<FlFaculty> flFacultyList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "courseid")
    private List<FlStudent> flStudentList;

    public FlCourse() {
    }

    public FlCourse(Integer courseid) {
        this.courseid = courseid;
    }

    public FlCourse(Integer courseid, String courseName, float fee, String prerequisite) {
        this.courseid = courseid;
        this.courseName = courseName;
        this.fee = fee;
        this.prerequisite = prerequisite;
    }

    public Integer getCourseid() {
        return courseid;
    }

    public void setCourseid(Integer courseid) {
        this.courseid = courseid;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public float getFee() {
        return fee;
    }

    public void setFee(float fee) {
        this.fee = fee;
    }

    public String getPrerequisite() {
        return prerequisite;
    }

    public void setPrerequisite(String prerequisite) {
        this.prerequisite = prerequisite;
    }

    @XmlTransient
    public List<FlCoursemasterial> getFlCoursemasterialList() {
        return flCoursemasterialList;
    }

    public void setFlCoursemasterialList(List<FlCoursemasterial> flCoursemasterialList) {
        this.flCoursemasterialList = flCoursemasterialList;
    }

    @XmlTransient
    public List<FlFaculty> getFlFacultyList() {
        return flFacultyList;
    }

    public void setFlFacultyList(List<FlFaculty> flFacultyList) {
        this.flFacultyList = flFacultyList;
    }

    @XmlTransient
    public List<FlStudent> getFlStudentList() {
        return flStudentList;
    }

    public void setFlStudentList(List<FlStudent> flStudentList) {
        this.flStudentList = flStudentList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (courseid != null ? courseid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FlCourse)) {
            return false;
        }
        FlCourse other = (FlCourse) object;
        if ((this.courseid == null && other.courseid != null) || (this.courseid != null && !this.courseid.equals(other.courseid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FlCourse[ courseid=" + courseid + " ]";
    }
    
}
